import request from '@/utils/request'

// 查询客户报修抢修列表
export function listCustomerRepair(query) {
  return request({
    url: '/web/CustomerRepair/list',
    method: 'get',
    params: query
  })
}

// 查询客户报修抢修详细
export function getCustomerRepair(customerKey) {
  return request({
    url: '/web/CustomerRepair/' + customerKey,
    method: 'get'
  })
}

// 查询客户报修抢修详细（不用了）
export function getCustomerRepairInfo(customerKey) {
  return request({
    url: '/web/CustomerRepair/Ecors/' + customerKey,
    method: 'get'
  })
}
// 查询客户报修抢修详细
export function getCustomerRepairI(customerKey,loginmanId) {
  return request({
    url: `/api/EcorsScor?customerKey=${customerKey}&hasRead=false&loginmanId=${loginmanId}`,
    method: 'get'
  })
}

// 新增客户报修抢修
export function addCustomerRepair(data) {
  return request({
    // url: '/web/CustomerRepair',
    url: '/api/AddCustomerRepair',
    method: 'post',
    data: data
  })
}

// 修改客户报修抢修(新的用)
export function updateCustomer(data) {
  return request({
    url: '/web/CustomerRepair/edit',
    method: 'post',
    data: data
  })
}

// 关闭工单
export function closeOrder(params) {
  return request({
    url: '/api/close',
    method: 'post',
    data: params
  })
}

// 修改客户报修抢修
export function updateCustomerRepair(data) {
  return request({
    url: '/web/CustomerRepair',
    method: 'put',
    data: data
  })
}

// 删除客户报修抢修
export function delCustomerRepair(customerKey) {
  return request({
    url: '/web/CustomerRepair/' + customerKey,
    method: 'delete'
  })
}
//查所有的公司
export function getAllDepts(params) {
  return request({
    url: '/api/AllDepts/',
    method: 'post',
    data: params
  })
}

export function FrimUser(deptId) {
  return request({
    url: '/system/user/list?pageNum=1&pageSize=10000&deptId=' + deptId,
    method: 'get'
  })
}

export function EditCustomer(params) {
  return request({
    url: '/api/EditCuotomer',
    method: 'post',
    data: params
  })
}

// 查询项目下收款信息
export function Finance(params) {
  return request({
    url: '/api/Finance?id=' + params,
    method: 'get',
  })
}


// 查询登录人在非保修财务确认人员列表里（customerUnit）
export function FinanceList(params) {
  return request({
    url: '/api/checkFinancialAffairs',
    method: 'post',
    data: params
  })
}
// 非报修财务确认到账
export function confirmReceipt(params) {
  return request({
    url: '/api/FinalFinancialConfirmation',
    method: 'post',
    data: params
  })
}

// 调派
export function designate(params) {
  return request({
    url: '/api/designate/',
    method: 'post',
    data: params
  })
}

// 修改合同和报价信息
export function updateQuotation(params) {
  return request({
    url: '/api/updateQuotation',
    method: 'post',
    data: params
  })
}
